Unit Mov;


Interface

uses
GlobVar,Crt,graph,escreva,show;

procedure  MoveParaEsquerda;
Procedure MoveParaDireita;
Procedure MoveParaCima;
Procedure MoveParaBaixo;
Procedure MoveUP;
Procedure MoveDOWN;
Procedure MoveRapidoE;
Procedure MoveE;
Procedure MoveRapidoD;
Procedure MoveD;


Implementation



procedure  MoveParaEsquerda;
var fim  :  boolean;
                     begin
                          Mostra;
                          If u<15000 then begin
                               fim:=false;
                                   If (not EscapeEMG) then
                                   begin
                                     mostra;
                                     repeat
                                       mostra;
                                       if u<15000 then u:=u+20*EscX[IEscX] else fim:=true;
                                       mostra;
                                       until Keypressed or fim;
                                       mostra;
                                       end else u:=u+100*EscX[IEscX];
                                    end else u:=0;
                          Mostra;
                    end;


Procedure MoveParaDireita;
var fim : boolean;

   begin
    Mostra;
    If u>0 then begin
    fim:=true;
    if (Not EscapeEMG) then
          begin
             mostra;
               repeat
                 mostra;
                  if u>0 then u:=u-20*EscX[IEscX] else fim:=true;
                  mostra;
                until keypressed or fim;
                mostra;
             end  else u:=u-100*EscX[IEscX];
           end else u:=15000;
        Mostra;
     end;

Procedure MoveParaCima;

begin
     Mostra;
     a:=a-b div 4;
     Mostra;
end;

Procedure MoveParaBaixo;

begin
  Mostra;
  a:=a+b div 4;
  Mostra;
end;

Procedure MoveUP;
var  OldV  :  integer;

  begin
    OldV:=v;
    Mostra;
    a:=a-b div 4;
    Mostra;
    v:=OldV;
  end;

Procedure MoveDOWN;
var  OldV  :  integer;

  begin
    OldV:=v;
    Mostra;
    a:=a+b div 4;
    Mostra;
    v:=OldV;
  end;

Procedure MoveRapidoE;
var fim :  boolean;
   begin
       Mostra;
       If u<15000 then
         begin
           fim:=false;
            u:=u+100*EscX[IescX];
      bar(2,2,62,12);
      OutTextXY(5,5,int2str(u div (100*escx[IescX])));
            {u:=u+10;}
          end else
          begin
             u:=0;
            end;
          Mostra;
          If (not escapeRp) then
   begin
      bar(2,2,62,12);
      OutTextXY(5,5,int2str(u div (100*escx[IescX])));
   end;
 end;

Procedure MoveE;
var fim :  boolean;
   begin
       Mostra;
       If u+10<13000 then
         begin
           fim:=false;
            u:=u+10;
            {u:=u+10;}
          end else
          begin
             u:=0;
              bar(2,2,42,12);
      OutTextXY(5,5,int2str(u div 100));
            end;
          Mostra;
          If (not escapeRp) then
   begin
      bar(2,2,32,12);
      OutTextXY(5,5,int2str(u div (100*escx[IescX])));
   end;
 end;

Procedure MoveRapidoD;

var  fim:  boolean;

begin
  Mostra;
   If (u>0) then
   begin
   fim:=false;
   u:=u-100*Escx[IescX];
   {u:=u-10;}
   end else
    begin
     u:=16000-(100*EscX[IescX]);
      end;
   Mostra;
  { If (not escapeRp) then}
   begin
      bar(2,2,62,12);
      OutTextXY(5,5,int2str(u div (100*escx[IescX])));
   end;
end;

Procedure MoveD;

var  fim:  boolean;

begin
  Mostra;
   If (u>0) then
   begin
   fim:=false;
   u:=u-10;
   {u:=u-10;}
   end else
    begin
     u:=8000-(100*EscX[IescX]);
      bar(2,2,42,12);
      OutTextXY(5,5,int2str(u));
      end;
   Mostra;
   If (not escapeRp) then
   begin
      bar(2,2,32,12);
      OutTextXY(5,5,int2str(u div (100*escx[IescX])));
   end;
end;
end.
